package com.ruoyi.web.controller.app.pay.util;


import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author Liufm
 * @data：2018年5月1日
 * @tags:
 * @todo:返回参数组装-封装类
 */
public class ResultMap {
	
	public static final Map<String, Object> SUCCESS_MAP = convertMap(StaticCode.SUCCESS_CODE);
    public static final Map<String, Object> FAIL_MAP = convertMap(StaticCode.FALSEA_CODE);
    
    
    public static Map<String, Object> convertMap(Integer stateCode)
    {
        return convertMap(stateCode, null, null);
    }
    
    public static Map<String, Object> convertMap(Integer stateCode, Object data)
    {
        return convertMap(stateCode, data, null);
    }
    
    public static Map<String, Object> convertMap(Integer stateCode, String message)
    {
        return convertMap(stateCode, null, message);
    }
    
    public static Map<String, Object> convertMap(Integer stateCode, Object data, String message)
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("stateCode", stateCode);
        map.put("data", data);
        map.put("message", message==null?"":message);
        return map;
    }

    public static Map<String, Object> convertMap(Integer stateCode,int status, Object data)
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("stateCode", stateCode);
        map.put("status", status);
        map.put("data", data);
        return map;
    }
    public static Map<String, Object> getSuccessMap(Object data)
    {
        return convertMap(StaticCode.SUCCESS_CODE, data);
    }
    //业主验证返回！
    public static Map<String, Object> getSuccessMap(int status,Object data)
    {
        return convertMap(StaticCode.SUCCESS_CODE,status,data);
    }
    public static Map<String,Object> getSuccessMap(){
        return convertMap(StaticCode.SUCCESS_CODE);
    }
    public static Map<String,Object> getSuccessMap(String message){
        return convertMap(StaticCode.SUCCESS_CODE,message);
    }
    public static Map<String,Object> getSuccessMap(Object data,String message){
        return convertMap(StaticCode.SUCCESS_CODE,data,message);
    }
    public static Map<String, Object> getFailMap(String message)
    {
        return convertMap(StaticCode.FALSEA_CODE, message);
    }
    public static Map<String, Object> getFailMap(Object data)
    {
        return convertMap(StaticCode.FALSEA_CODE, data);
    }


}
